home *** CD-ROM | disk | FTP | other *** search
Text File | 2007-10-01 | 48.0 KB | 1,622 lines |
- function initMenu()
- {
- menu_mc.tali_mc.gotoAndStop(1);
- menu_mc.jalan_mc.gotoAndStop(2);
- menu_mc.mark_mc.gotoAndStop(1);
- menu_mc.jason_mc.gotoAndStop(2);
- menu_mc.nama_mc.gotoAndStop(1);
- menu_mc.jason_mc.enabled = true;
- menu_mc.mark_mc.enabled = true;
- menu_mc.tali_mc.enabled = true;
- menu_mc.jalan_mc.enabled = true;
- menu_mc.mark_mc.onRelease = char1.onRelease = function()
- {
- if(!xjatuh)
- {
- sChar = 1;
- dChar = 0;
- menu_mc.mark_mc.gotoAndStop(1);
- menu_mc.jason_mc.gotoAndStop(2);
- menu_mc.nama_mc.gotoAndStop(1);
- }
- };
- menu_mc.jason_mc.onRelease = char0.onRelease = function()
- {
- if(!xjatuh)
- {
- sChar = 0;
- dChar = 1;
- menu_mc.mark_mc.gotoAndStop(2);
- menu_mc.jason_mc.gotoAndStop(1);
- menu_mc.nama_mc.gotoAndStop(2);
- }
- };
- menu_mc.jalan_mc.onRelease = function()
- {
- abilChar = "jalan";
- menu_mc.tali_mc.gotoAndStop(2);
- menu_mc.jalan_mc.gotoAndStop(1);
- };
- menu_mc.tali_mc.onRelease = function()
- {
- abilChar = "tali";
- menu_mc.tali_mc.gotoAndStop(1);
- menu_mc.jalan_mc.gotoAndStop(2);
- };
- menu_mc.reset_btn.enabled = true;
- menu_mc.back_btn.enabled = true;
- menu_mc.reset_btn.onRelease = function()
- {
- cekLose();
- };
- menu_mc.back_btn.onRelease = function()
- {
- clearSemua();
- _root.gotoAndStop(2);
- };
- }
- function clearSemua()
- {
- delete _root.onEnterFrame;
- clearInterval(idJatuh);
- clearInterval(idWaktu);
- i = 0;
- while(i <= panjang)
- {
- j = 0;
- while(j <= lebar)
- {
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- removeMovieClip(_root[namaBaru]);
- removeMovieClip("back_mc");
- removeMovieClip("menu_mc");
- removeMovieClip("char0");
- removeMovieClip("char1");
- removeMovieClip("msgBox_mc");
- j++;
- }
- i++;
- }
- }
- function initAwal()
- {
- mapKe = 1;
- back_mc.gotoAndStop(mapKe);
- waktu = 0;
- }
- function waktuMaju()
- {
- waktu++;
- }
- function init()
- {
- panjang = 19;
- lebar = 14;
- speedChar0 = 3;
- speedChar1 = 5;
- jumlahKeluar = 0;
- xtaliNaik = false;
- xtaliTurun = false;
- xjatuh = false;
- xbisa = false;
- batuJatuh = undefined;
- sudahJatuh = false;
- sedangBuatTali = false;
- sedangAngkat = false;
- xambilTali = false;
- xdiem = false;
- switchBuka = false;
- sedangNahan = false;
- posisiXChar = new Array();
- posisiYChar = new Array();
- posChar = new Array();
- jatuhChar = new Array();
- xposSwitchJ = new Array(10,10,3);
- xposSwitchI = new Array(10,8,11);
- xposBukaJ = new Array(1,10,3);
- xposBukaI = new Array(3,14,19);
- xswitchBuka = new Array(false,false,false);
- sudahAtas = new Array();
- sudahBawah = new Array();
- gerakBawahAwal = new Array();
- gerakAtasAwal = new Array();
- awalTurun = new Array(false,false);
- dalam1 = 1;
- abilChar = "tali";
- if(mapKe == 1)
- {
- tanah = 3;
- tali = 2;
- back_mc.kotak2._visible = false;
- back_mc.kotak1._visible = false;
- }
- else if(mapKe == 2)
- {
- tanah = 4;
- tali = 2;
- back_mc.kotak2._visible = false;
- back_mc.kotak1._visible = true;
- }
- else if(mapKe == 3)
- {
- tanah = 3;
- tali = 2;
- back_mc.kotak2._visible = true;
- back_mc.kotak1._visible = false;
- }
- sChar = 1;
- dChar = 0;
- jumlahChar = 2;
- mapping1 = [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[10,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,7,6,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,15,15],[0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,16,0,0,0,0],[0,0,0,0,0,1,1,1,1,1,8,0,0,1,1,1,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,16,0,0,0,11,0,0,0,0,0,0],[2,3,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0],[1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];
- mapping2 = [[0,0,7,0,19,19,0,0,0,0,0,0,0,0,0,0,0,0,13,0],[0,0,7,10,19,19,0,0,7,7,7,7,0,0,0,0,0,0,0,0],[1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,16,6,0,11,0,0,0,0,0,0,0,10],[0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,1,1,1,0,1],[1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,0,0],[0,0,0,0,1,1,1,0,1,8,1,1,1,1,1,1,1,1,1,1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[2,3,0,0,0,0,0,0,11,0,11,0,0,0,10,0,0,0,0,12],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];
- mapping3 = [[0,0,0,0,0,0,13,1,1,1,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[2,3,0,0,0,0,0,10,16,12,0,0,0,0,0,9,0,0,0,0],[1,1,1,0,0,1,0,1,1,1,1,0,0,0,1,1,18,1,1,1],[0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,1,0,0,0],[0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,1,0,0,0,1,1,0,0,1,0,0,0,19,19],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,19],[0,0,0,0,0,0,0,0,0,7,9,9,0,0,0,0,0,1,1,1],[0,0,0,0,0,0,0,0,0,9,7,9,0,0,0,0,0,0,0,0],[0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,11,6,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];
- }
- function buatKotak()
- {
- batuJatuh2 = false;
- mapping = this["mapping" + mapKe];
- adaJem = new Array();
- i = 0;
- while(i <= panjang)
- {
- adaJem[i] = new Array();
- j = 0;
- while(j <= lebar)
- {
- adaJem[j][i] = false;
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- this.attachMovie("kotak_mc",namaBaru,dalam1);
- iniJalan = false;
- if(mapping[j][i] == 0)
- {
- this[namaBaru].gotoAndStop(1);
- }
- else if(mapping[j][i] == 1)
- {
- this[namaBaru].gotoAndStop(2);
- }
- else if(mapping[j][i] == 2)
- {
- this[namaBaru].gotoAndStop(1);
- this.attachMovie("char0","char0",1000);
- posisiXChar[0] = j;
- posisiYChar[0] = i;
- char0._x = i * 40;
- char0._y = j * 40;
- mapping[j][i] = 0;
- }
- else if(mapping[j][i] == 3)
- {
- this[namaBaru].gotoAndStop(1);
- this.attachMovie("char1","char1",1001);
- posisiXChar[1] = j;
- posisiYChar[1] = i;
- char1._x = i * 40;
- char1._y = j * 40;
- mapping[j][i] = 0;
- }
- else if(mapping[j][i] == 4)
- {
- this[namaBaru].gotoAndStop(4);
- }
- else if(mapping[j][i] == 6)
- {
- this[namaBaru].gotoAndStop(6);
- }
- else if(mapping[j][i] == 7)
- {
- this[namaBaru].gotoAndStop(7);
- }
- else if(mapping[j][i] == 8)
- {
- this[namaBaru].gotoAndStop(8);
- }
- else if(mapping[j][i] == 9)
- {
- this[namaBaru].gotoAndStop(9);
- }
- else if(mapping[j][i] == 10)
- {
- this[namaBaru].gotoAndStop(10);
- }
- else if(mapping[j][i] == 11)
- {
- mapping[j - 1][i] = 7;
- mapping[j][i] = 7;
- this[namaBaru].gotoAndStop(11);
- posSwitchJ = j;
- posSwitchI = i;
- }
- else if(mapping[j][i] == 12)
- {
- this[namaBaru].gotoAndStop(12);
- }
- else if(mapping[j][i] == 13)
- {
- mapping[j][i] = 7;
- this[namaBaru].gotoAndStop(13);
- this[namaBaru]._visible = false;
- }
- else if(mapping[j][i] == 14)
- {
- batuJatuh2 = true;
- mapping[j][i] = 7;
- this[namaBaru].gotoAndStop(14);
- batu2 = namaBaru;
- xbatu2 = namaBaru;
- }
- else if(mapping[j][i] == 15)
- {
- mapping[j][i] = 0;
- this[namaBaru].gotoAndStop(15);
- }
- else if(mapping[j][i] == 16)
- {
- mapping[j][i] = 7;
- this[namaBaru].gotoAndStop(16);
- }
- else if(mapping[j][i] == 17)
- {
- mapping[j - 1][i] = 7;
- mapping[j][i] = 7;
- this[namaBaru].gotoAndStop(17);
- }
- else if(mapping[j][i] == 18)
- {
- mapping[j][i] = 0;
- this[namaBaru].gotoAndStop(18);
- }
- else if(mapping[j][i] == 19)
- {
- mapping[j][i] = 7;
- }
- this[namaBaru]._x = i * 40;
- this[namaBaru]._y = j * 40;
- dalam1++;
- j++;
- }
- i++;
- }
- }
- function jatuh()
- {
- if(xjatuh)
- {
- if(posisiXChar[sChar] <= lebar)
- {
- posisiXChar[sChar]++;
- _root["char" + sChar]._y = posisiXChar[sChar] * 40;
- if(mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 1 || mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 4 || mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 9)
- {
- xjatuh = false;
- }
- }
- else
- {
- xjatuh = false;
- cekLose();
- }
- }
- if(sudahJatuh == true)
- {
- if(batuJatuh)
- {
- _root[batu].gotoAndStop(7);
- myStr = new String(_root[batu]);
- indiI = int(myStr.substr(myStr.length - 4,2));
- indiJ = int(myStr.substr(myStr.length - 2,2));
- indiJ++;
- xindiJ = indiJ - 1;
- ubahDalam("indiI","indiJ","dalam2");
- namaBaru2 = "kotak" + dalam2;
- if(posisiXChar[0] == indiJ + 1 && posisiYChar[0] == indiI)
- {
- char0.anim_char.gotoAndStop(9);
- sedangNahan = true;
- batuJatuh = false;
- }
- else if(posisiXChar[1] == indiJ && posisiYChar[1] == indiI)
- {
- cekLose();
- }
- else if(_root[namaBaru2]._currentframe == 2 || _root[namaBaru2]._currentframe == 5 || _root[namaBaru2]._currentframe == 9 || _root[namaBaru2]._currentframe == 7)
- {
- sudahJatuh = false;
- batuJatuh = false;
- mapping[xindiJ - 1][indiI] = 0;
- mapping[indiJ - 1][indiI] = 7;
- }
- else
- {
- batuJatuh = true;
- _root[namaBaru2].gotoAndStop(13);
- _root[batu].gotoAndStop(1);
- mapping[xindiJ][indiI] = 1;
- mapping[indiJ][indiI] = 7;
- batu = namaBaru2;
- }
- }
- }
- if(batuJatuh2)
- {
- _root[batu2].gotoAndStop(14);
- myStr = new String(_root[batu2]);
- indiI = int(myStr.substr(myStr.length - 4,2));
- indiJ = int(myStr.substr(myStr.length - 2,2));
- indiJ++;
- xindiJ = indiJ - 1;
- ubahDalam("indiI","indiJ","dalam2");
- namaBaru2 = "kotak" + dalam2;
- if(_root[namaBaru2]._currentframe == 2)
- {
- _root[batu2].gotoAndStop(1);
- _root[xbatu2].gotoAndStop(14);
- batu2 = xbatu2;
- batuJatuh2 = true;
- mapping[xindiJ][indiI] = 1;
- mapping[indiJ][indiI] = 7;
- }
- else if(posisiXChar[0] == indiJ + 1 && posisiYChar[0] == indiI)
- {
- batuJatuh2 = false;
- }
- else
- {
- batuJatuh2 = true;
- _root[namaBaru2].gotoAndStop(14);
- _root[batu2].gotoAndStop(1);
- mapping[xindiJ][indiI] = 1;
- mapping[indiJ][indiI] = 7;
- batu2 = namaBaru2;
- }
- }
- }
- function cekLose()
- {
- init();
- buatKotak();
- buatChar();
- initMenu();
- }
- function cekWin()
- {
- if(mapping[posisiXChar[sChar]][posisiYChar[sChar]] == 6)
- {
- jumlahKeluar++;
- _root["char" + sChar]._visible = false;
- xjatuh = false;
- if(sChar == 1)
- {
- sChar = 0;
- dChar = 1;
- menu_mc.mark_mc.enabled = false;
- menu_mc.tali_mc.enabled = false;
- menu_mc.jalan_mc.enabled = false;
- menu_mc.tali_mc.gotoAndStop(2);
- menu_mc.jalan_mc.gotoAndStop(2);
- menu_mc.jalan_mc.enabled = false;
- menu_mc.nama_mc.gotoAndStop(2);
- menu_mc.jason_mc.gotoAndStop(1);
- menu_mc.mark_mc.gotoAndStop(2);
- }
- else if(sChar == 0)
- {
- sChar = 1;
- dChar = 0;
- menu_mc.nama_mc.gotoAndStop(1);
- menu_mc.jason_mc.gotoAndStop(2);
- menu_mc.mark_mc.gotoAndStop(1);
- menu_mc.jason_mc.enabled = false;
- }
- }
- if(jumlahKeluar == 2)
- {
- mapKe++;
- if(mapKe <= 3)
- {
- back_mc.gotoAndStop(mapKe);
- init();
- buatKotak();
- buatChar();
- initMenu();
- }
- else
- {
- mulaiMain = false;
- clearInterval(idWaktu);
- menu_mc.reset_btn.enabled = false;
- menu_mc.back_btn.enabled = true;
- _root.attachMovie("msgBox_mc","msgBox_mc",100000);
- msgBox_mc._x = Stage.width / 2;
- msgBox_mc._y = Stage.height / 2 - 100;
- msgBox_mc.yes_btn.onRelease = function()
- {
- msgBox_mc.gotoAndStop(2);
- };
- msgBox_mc.no_btn.onRelease = function()
- {
- clearSemua();
- _root.gotoAndStop(2);
- };
- }
- }
- }
- function topTen()
- {
- skorOrang = String(waktu);
- rand1 = Math.random() * 1000000;
- myData = new LoadVars();
- myData.sendAndLoad("flash_scores.php?" + rand1 + "&newname=" + namaOrang + "&newscore=" + skorOrang,"POST");
- myData.onLoad = function(success)
- {
- if(success)
- {
- delete msgBox_mc.onEnterFrame;
- clearSemua();
- gotoAndStop("high");
- }
- else
- {
- delete msgBox_mc.onEnterFrame;
- msgBox_mc.gotoAndStop(3);
- }
- };
- }
- function topTen2()
- {
- clearSemua();
- gotoAndStop("menu");
- }
- function klikChar1()
- {
- if(!xjatuh)
- {
- sChar = 0;
- dChar = 1;
- }
- }
- function klikChar2()
- {
- if(!xjatuh)
- {
- sChar = 1;
- dChar = 0;
- }
- }
- function cekChar(indi)
- {
- if(mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 0)
- {
- xjatuh = true;
- }
- else if(mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 8)
- {
- j = posisiXChar[sChar] + 1;
- i = posisiYChar[sChar];
- cekDalam(1);
- mapping[j][i] = 0;
- xjatuh = true;
- }
- else if(mapping[posisiXChar[sChar]][posisiYChar[sChar]] == 10)
- {
- if(mapKe == 2)
- {
- i = 0;
- while(i <= 2)
- {
- if(posisiXChar[sChar] == xposBukaJ[i] && posisiYChar[sChar] == xposBukaI[i])
- {
- posisiKe = i;
- i = 2;
- }
- i++;
- }
- }
- cekBuka("pintu");
- }
- else if(mapping[posisiXChar[sChar]][posisiYChar[sChar]] == 12)
- {
- cekBuka("batu");
- }
- }
- function cekBuka(opsi)
- {
- i = 0;
- while(i <= panjang)
- {
- j = 0;
- while(j <= lebar)
- {
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- if(opsi == "pintu")
- {
- if(mapKe == 2)
- {
- if(j == xposSwitchJ[posisiKe] && i == xposSwitchI[posisiKe])
- {
- if(xswitchBuka[posisiKe] == false)
- {
- xswitchBuka[posisiKe] = true;
- _root[namaBaru].gotoAndStop(1);
- mapping[j - 1][i] = 0;
- mapping[j][i] = 0;
- }
- else
- {
- xswitchBuka[posisiKe] = false;
- _root[namaBaru].gotoAndStop(11);
- mapping[j - 1][i] = 7;
- mapping[j][i] = 7;
- }
- i = panjang;
- j = lebar;
- }
- }
- else if(j == posSwitchJ && i == posSwitchI)
- {
- if(switchBuka == false)
- {
- switchBuka = true;
- _root[namaBaru].gotoAndStop(1);
- mapping[j - 1][i] = 0;
- mapping[j][i] = 0;
- }
- else
- {
- switchBuka = false;
- _root[namaBaru].gotoAndStop(11);
- mapping[j - 1][i] = 7;
- mapping[j][i] = 7;
- }
- i = panjang;
- j = lebar;
- }
- }
- else if(opsi == "batu")
- {
- if(_root[namaBaru]._currentframe == 13)
- {
- batu = namaBaru;
- batuJatuh = true;
- i = panjang;
- j = lebar;
- sudahJatuh = true;
- }
- }
- j++;
- }
- i++;
- }
- }
- function gerakKanan()
- {
- if(mapping[posisiXChar[sChar] + 1][posisiYChar[sChar] + 1] != 0 || mapping[posisiXChar[sChar]][posisiYChar[sChar] + 1] == 6)
- {
- if(mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] + 1] != 7 && mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] + 1] != 9)
- {
- if(posisiYChar[sChar] + 1 <= panjang && (mapping[posisiXChar[sChar]][posisiYChar[sChar] + 1] != 7 && mapping[posisiXChar[sChar]][posisiYChar[sChar] + 1] != 9))
- {
- _root["char" + sChar].anim_char.gotoAndStop(2);
- jalanKanan = true;
- xdiem = true;
- gerakAtasAwal[sChar] = true;
- gerakBawahAwal[sChar] = true;
- }
- }
- }
- }
- function gerakKiri()
- {
- if(mapping[posisiXChar[sChar] + 1][posisiYChar[sChar] - 1] != 0 || mapping[posisiXChar[sChar]][posisiYChar[sChar] - 1] == 6)
- {
- if(mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] - 1] != 7 && mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] - 1] != 9)
- {
- if(posisiYChar[sChar] - 1 >= 0 && (mapping[posisiXChar[sChar]][posisiYChar[sChar] - 1] != 7 && mapping[posisiXChar[sChar]][posisiYChar[sChar] - 1] != 9))
- {
- _root["char" + sChar].anim_char.gotoAndStop(2);
- jalanKiri = true;
- xdiem = true;
- gerakAtasAwal[sChar] = true;
- gerakBawahAwal[sChar] = true;
- }
- }
- }
- }
- function gerakAtas()
- {
- if(sedangAngkat == false && sChar == 0 || sChar == 1)
- {
- if(mapping[posisiXChar[sChar] - 1][posisiYChar[sChar]] != 7 && mapping[posisiXChar[sChar] - 1][posisiYChar[sChar]] != 9)
- {
- j = posisiXChar[sChar];
- i = posisiYChar[sChar];
- cekDalam();
- if(_root[namaBaru]._currentframe == 4 || _root[namaBaru]._currentframe == 5)
- {
- if(mapping[j - 2][i] == 0 || mapping[j - 2][i] == 10 || mapping[j - 2][i] == 12)
- {
- sudahAtas[sChar] = true;
- }
- else
- {
- sudahAtas[sChar] = false;
- }
- gerakBawahAwal[sChar] = false;
- if(gerakAtasAwal[sChar])
- {
- _root["char" + sChar].anim_char.gotoAndStop(4);
- _root["char" + sChar].anim_char.naik.gotoAndStop(1);
- gerakAtasAwal[sChar] = false;
- jalanAtas = true;
- }
- else
- {
- _root["char" + sChar].anim_char.gotoAndStop(4);
- _root["char" + sChar].anim_char.naik.gotoAndPlay(1);
- jalanAtas = true;
- xdiem = true;
- }
- }
- }
- }
- }
- function gerakBawah()
- {
- if(sedangAngkat == false && sChar == 0 || sChar == 1)
- {
- if(mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] != 7)
- {
- j = posisiXChar[sChar] + 1;
- i = posisiYChar[sChar];
- cekDalam();
- if(_root[namaBaru]._currentframe == 4 || _root[namaBaru]._currentframe == 5)
- {
- if(sChar == 0 && sedangNahan == false || sChar == 1)
- {
- if(mapping[j - 1][i] == 0 || mapping[j - 1][i] == 10 || mapping[j - 1][i] == 12)
- {
- sudahBawah[sChar] = true;
- }
- else
- {
- sudahBawah[sChar] = false;
- }
- if(gerakBawahAwal[sChar])
- {
- _root["char" + sChar].anim_char.gotoAndStop(5);
- _root["char" + sChar].anim_char.bawah.gotoAndPlay(1);
- gerakBawahAwal[sChar] = false;
- jalanBawah = true;
- xdiem = true;
- awalTurun[sChar] = true;
- }
- else
- {
- j = posisiXChar[sChar] + 2;
- i = posisiYChar[sChar];
- cekDalam();
- if(_root[namaBaru]._currentframe != 4)
- {
- posisiXChar[sChar]++;
- _root["char" + sChar].anim_char.gotoAndStop(1);
- _root["char" + sChar]._y = posisiXChar[sChar] * 40;
- gerakBawahAwal[sChar] = true;
- awalTurun[sChar] = false;
- }
- else
- {
- awalTurun[sChar] = false;
- _root["char" + sChar].anim_char.gotoAndStop(5);
- _root["char" + sChar].anim_char.bawah.gotoAndPlay(10);
- jalanBawah = true;
- xdiem = true;
- }
- }
- }
- }
- cekWin();
- }
- }
- }
- function buatJalan()
- {
- if(tanah >= 1)
- {
- if(_root["char" + sChar]._currentframe == 1)
- {
- j = posisiXChar[sChar] + 1;
- i = posisiYChar[sChar] + 1;
- }
- else if(_root["char" + sChar]._currentframe == 2)
- {
- j = posisiXChar[sChar] + 1;
- i = posisiYChar[sChar] - 1;
- }
- if(mapping[posisiXChar[sChar]][posisiYChar[sChar]] == 0 && (mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 4 || mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 1))
- {
- if(mapping[j][i] != 1)
- {
- _root["char" + sChar].anim_char.gotoAndStop(6);
- tanah--;
- }
- iniJalan = true;
- cekDalam(2);
- adaJem[j][i] = true;
- mapping[j][i] = 1;
- }
- }
- }
- function buatTali()
- {
- if(sedangBuatTali)
- {
- if(tali >= 1)
- {
- if(_root["char" + sChar]._currentframe == 1 || _root["char" + sChar]._currentframe == 2)
- {
- j = posisiXChar[sChar];
- i = posisiYChar[sChar];
- }
- tali--;
- tanda = 5;
- taliNaik = true;
- idTali = setInterval(xtali,250);
- }
- }
- }
- function buatTali2()
- {
- if(sedangBuatTali)
- {
- if(tali >= 1)
- {
- if(_root["char" + sChar]._currentframe == 1 || _root["char" + sChar]._currentframe == 2)
- {
- j = posisiXChar[sChar] + 1;
- i = posisiYChar[sChar];
- }
- tali--;
- tanda = 5;
- iniJalan = true;
- taliNaik = true;
- idTali2 = setInterval(xtali2,250);
- }
- }
- }
- function cekTeman(posisi)
- {
- if(posisi == "kanan")
- {
- xj = posisiXChar[sChar];
- xi = posisiYChar[sChar] + 1;
- }
- else if(posisi == "kiri")
- {
- xj = posisiXChar[sChar];
- xi = posisiYChar[sChar] - 1;
- }
- else if(posisi == "atas")
- {
- xj = posisiXChar[sChar] - 1;
- xi = posisiYChar[sChar];
- }
- else if(posisi == "bawah")
- {
- xj = posisiXChar[sChar] + 1;
- xi = posisiYChar[sChar];
- }
- if(xj == posisiXChar[dChar] && xi == posisiYChar[dChar])
- {
- xbisa = false;
- }
- else if(mapping[xj + 1][xi] == 0)
- {
- xbisa = false;
- }
- else if(!(xj - 1 == posisiXChar[dChar] && xi == posisiYChar[dChar]))
- {
- xbisa = true;
- }
- }
- function ambilTali()
- {
- if(xambilTali)
- {
- xdiem = true;
- j = posisiAmbilX2;
- i = posisiAmbilY;
- if(adaJem[j][i])
- {
- iniJalan = true;
- }
- else
- {
- iniJalan = false;
- }
- cekDalam(1);
- mapping[j][i] = 0;
- posisiAmbilX2--;
- if(posisiAmbilX2 == posisiAmbilX)
- {
- tali++;
- j = posisiAmbilX2;
- i = posisiAmbilY;
- if(adaJem[j][i])
- {
- iniJalan = true;
- }
- else
- {
- iniJalan = false;
- }
- cekDalam(2);
- mapping[posisiAmbilX2][posisiAmbilY] = 1;
- xambilTali = false;
- xdiem = false;
- clearInterval(idAmbil);
- }
- }
- }
- function ambilTali2()
- {
- if(xambilTali)
- {
- xdiem = true;
- j = posisiAmbilX2;
- i = posisiAmbilY;
- if(adaJem[j][i])
- {
- iniJalan = true;
- }
- else
- {
- iniJalan = false;
- }
- cekDalam(1);
- mapping[j][i] = 0;
- posisiAmbilX2++;
- if(posisiAmbilX2 == posisiAmbilX)
- {
- tali++;
- j = posisiAmbilX2;
- i = posisiAmbilY;
- if(adaJem[j][i])
- {
- iniJalan = true;
- }
- else
- {
- iniJalan = false;
- }
- cekDalam(1);
- mapping[posisiAmbilX2][posisiAmbilY] = 0;
- xambilTali = false;
- xdiem = false;
- clearInterval(idAmbil2);
- }
- }
- }
- function xtali()
- {
- if(sedangBuatTali)
- {
- if(taliNaik)
- {
- cekDalam(4);
- mapping[j][i] = 4;
- j--;
- tanda--;
- if(mapping[j][i] == 1)
- {
- clearInterval(idTali);
- if(adaJem[j][i])
- {
- iniJalan = true;
- }
- else
- {
- iniJalan = false;
- }
- cekDalam(5);
- mapping[j][i] = 4;
- sedangBuatTali = false;
- xdiem = false;
- }
- else if(tanda <= 0 || mapping[j][i] == undefined || mapping[j][i] >= 6)
- {
- taliNaik = false;
- }
- }
- else
- {
- if(mapping[j][i] < 6)
- {
- cekDalam(1);
- mapping[j][i] = 0;
- }
- j++;
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- if(mapping[j][i] == 1 || _root[namaBaru]._currentframe == 5)
- {
- clearInterval(idTali);
- sedangBuatTali = false;
- xdiem = false;
- tali++;
- }
- }
- }
- }
- function xtali2()
- {
- if(sedangBuatTali)
- {
- if(taliNaik)
- {
- if(tanda == 5)
- {
- if(adaJem[j][i])
- {
- iniJalan = true;
- }
- else
- {
- iniJalan = false;
- }
- cekDalam(5);
- mapping[j][i] = 4;
- }
- else
- {
- if(adaJem[j][i])
- {
- iniJalan = true;
- }
- else
- {
- iniJalan = false;
- }
- cekDalam(4);
- mapping[j][i] = 4;
- }
- j++;
- tanda--;
- if(mapping[j][i] == 1 || mapping[j][i] == 4)
- {
- clearInterval(idTali2);
- sedangBuatTali = false;
- xdiem = false;
- }
- else if(tanda <= 0 || mapping[j][i] == undefined || mapping[j][i] >= 6)
- {
- taliNaik = false;
- }
- }
- else
- {
- if(mapping[j][i] < 6)
- {
- cekDalam(1);
- mapping[j][i] = 0;
- }
- j--;
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- if(mapping[j][i] == 1 || _root[namaBaru]._currentframe == 5)
- {
- if(adaJem[j][i])
- {
- iniJalan = true;
- }
- else
- {
- iniJalan = false;
- }
- cekDalam(2);
- mapping[j][i] = 1;
- clearInterval(idTali2);
- sedangBuatTali = false;
- xdiem = false;
- tali++;
- }
- }
- }
- }
- function cekKuat()
- {
- if(_root["char" + sChar]._currentframe == 1)
- {
- if(_root["char" + sChar].anim_char._currentframe == 1)
- {
- if(sedangAngkat == false)
- {
- _root["char" + sChar].anim_char.gotoAndStop(6);
- }
- }
- if(mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] + 1] == 7)
- {
- j = posisiXChar[sChar] - 1;
- i = posisiYChar[sChar] + 1;
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- if(_root[namaBaru]._currentframe == 7)
- {
- cekDalam(1);
- mapping[j][i] = 0;
- }
- }
- else if(mapping[posisiXChar[sChar]][posisiYChar[sChar] + 1] == 7 && mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] + 1] == 0)
- {
- j = posisiXChar[sChar];
- i = posisiYChar[sChar] + 1;
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- if(_root[namaBaru]._currentframe == 7)
- {
- cekDalam(1);
- mapping[j][i] = 0;
- }
- }
- else if(sedangAngkat == false)
- {
- if(mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] + 1] == 9)
- {
- _root["char" + sChar].anim_char.gotoAndStop(7);
- j = posisiXChar[sChar] - 1;
- i = posisiYChar[sChar] + 1;
- cekDalam(1);
- mapping[j][i] = 0;
- sedangAngkat = true;
- }
- else if(mapping[posisiXChar[sChar]][posisiYChar[sChar] + 1] == 9)
- {
- _root["char" + sChar].anim_char.gotoAndStop(7);
- j = posisiXChar[sChar];
- i = posisiYChar[sChar] + 1;
- cekDalam(1);
- mapping[j][i] = 0;
- sedangAngkat = true;
- }
- }
- else if(sedangAngkat == true)
- {
- j = posisiXChar[sChar] + 1;
- i = posisiYChar[sChar] + 1;
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- if(mapping[posisiXChar[sChar]][posisiYChar[sChar] + 1] == 0 && mapping[posisiXChar[sChar] + 1][posisiYChar[sChar] + 1] != 0 || _root[namaBaru]._currentframe == 18)
- {
- cekTeman("kanan");
- if(xbisa)
- {
- j = posisiXChar[sChar];
- i = posisiYChar[sChar] + 1;
- cekDalam(9);
- mapping[j][i] = 9;
- sedangAngkat = false;
- _root["char" + sChar].anim_char.gotoAndStop(8);
- }
- else if(_root[namaBaru]._currentframe == 18)
- {
- j = posisiXChar[sChar] + 1;
- i = posisiYChar[sChar] + 1;
- cekDalam(9);
- mapping[j][i] = 9;
- sedangAngkat = false;
- _root["char" + sChar].anim_char.gotoAndStop(8);
- }
- }
- else if(mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] + 1] == 0)
- {
- cekTeman("kanan");
- if(xbisa)
- {
- j = posisiXChar[sChar] - 1;
- i = posisiYChar[sChar] + 1;
- cekDalam(9);
- mapping[j][i] = 9;
- sedangAngkat = false;
- xbisa = false;
- _root["char" + sChar].anim_char.gotoAndStop(8);
- }
- }
- }
- }
- else if(_root["char" + sChar]._currentframe == 2)
- {
- if(_root["char" + sChar].anim_char._currentframe == 1)
- {
- if(sedangAngkat == false)
- {
- _root["char" + sChar].anim_char.gotoAndStop(6);
- }
- }
- if(mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] - 1] == 7)
- {
- j = posisiXChar[sChar] - 1;
- i = posisiYChar[sChar] - 1;
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- if(_root[namaBaru]._currentframe == 7)
- {
- cekDalam(1);
- mapping[j][i] = 0;
- }
- }
- else if(mapping[posisiXChar[sChar]][posisiYChar[sChar] - 1] == 7 && mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] - 1] == 0)
- {
- j = posisiXChar[sChar];
- i = posisiYChar[sChar] - 1;
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- if(_root[namaBaru]._currentframe == 7)
- {
- cekDalam(1);
- mapping[j][i] = 0;
- }
- }
- else if(sedangAngkat == false)
- {
- if(mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] - 1] == 9)
- {
- _root["char" + sChar].anim_char.gotoAndStop(7);
- j = posisiXChar[sChar] - 1;
- i = posisiYChar[sChar] - 1;
- cekDalam(1);
- mapping[j][i] = 0;
- sedangAngkat = true;
- }
- else if(mapping[posisiXChar[sChar]][posisiYChar[sChar] - 1] == 9)
- {
- _root["char" + sChar].anim_char.gotoAndStop(7);
- j = posisiXChar[sChar];
- i = posisiYChar[sChar] - 1;
- cekDalam(1);
- mapping[j][i] = 0;
- sedangAngkat = true;
- }
- }
- else if(sedangAngkat == true)
- {
- if(mapping[posisiXChar[sChar]][posisiYChar[sChar] - 1] == 0 && mapping[posisiXChar[sChar] + 1][posisiYChar[sChar] - 1] != 0)
- {
- cekTeman("kiri");
- if(xbisa)
- {
- j = posisiXChar[sChar];
- i = posisiYChar[sChar] - 1;
- cekDalam(9);
- mapping[j][i] = 9;
- sedangAngkat = false;
- _root["char" + sChar].anim_char.gotoAndStop(8);
- }
- }
- else if(mapping[posisiXChar[sChar] - 1][posisiYChar[sChar] - 1] == 0)
- {
- cekTeman("kiri");
- if(xbisa)
- {
- j = posisiXChar[sChar] - 1;
- i = posisiYChar[sChar] - 1;
- cekDalam(9);
- mapping[j][i] = 9;
- sedangAngkat = false;
- xbisa = false;
- _root["char" + sChar].anim_char.gotoAndStop(8);
- }
- }
- }
- }
- }
- function cekDalam(indi)
- {
- ubahDalam("i","j","dalam");
- namaBaru = "kotak" + dalam;
- if(_root[namaBaru]._currentframe == 18 || _root[namaBaru]._currentframe == 1 || _root[namaBaru]._currentframe == 5 || _root[namaBaru]._currentframe == 2 || _root[namaBaru]._currentframe == 7 || _root[namaBaru]._currentframe == 8 || _root[namaBaru]._currentframe == 9 || _root[namaBaru]._currentframe == 4)
- {
- _root[namaBaru].gotoAndStop(indi);
- }
- }
- function ubahDalam(i, j, dalam)
- {
- if(this[i] < 10 && this[j] < 10)
- {
- this[dalam] = "0" + String(this[i]) + "0" + String(this[j]);
- }
- else if(this[i] < 10 && this[j] >= 10)
- {
- this[dalam] = "0" + String(this[i]) + String(this[j]);
- }
- else if(this[i] >= 10 && this[j] < 10)
- {
- this[dalam] = String(this[i]) + "0" + String(this[j]);
- }
- else
- {
- this[dalam] = String(this[i]) + String(this[j]);
- }
- }
- function input()
- {
- myListener = new Object();
- myListener.onKeyDown = function()
- {
- if(mulaiMain)
- {
- if(!xjatuh && !xdiem)
- {
- if(Key.getCode() == 38)
- {
- xtaliNaik = true;
- }
- if(Key.getCode() == 40)
- {
- xtaliTurun = true;
- }
- if(Key.getCode() == 37)
- {
- _root["char" + sChar].gotoAndStop(2);
- gerakKiri();
- }
- if(Key.getCode() == 39)
- {
- _root["char" + sChar].gotoAndStop(1);
- gerakKanan();
- }
- if(Key.getCode() == 38)
- {
- gerakAtas();
- }
- if(Key.getCode() == 40)
- {
- gerakBawah();
- }
- if(Key.getCode() == 67)
- {
- if(sChar == 1)
- {
- if(_root["char" + sChar].anim_char._currentframe == 1)
- {
- if(mapping[posisiXChar[sChar]][posisiYChar[sChar]] == 4)
- {
- j = posisiXChar[sChar] + 1;
- i = posisiYChar[sChar];
- ubahDalam("i","j","dalam3");
- namaBaru3 = "kotak" + dalam3;
- if(mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 1 || mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 4 && _root[namaBaru3]._currentframe == 5)
- {
- posisiAmbilX = posisiAmbilX2 = posisiXChar[sChar];
- posisiAmbilY = posisiYChar[sChar];
- adaOrang = false;
- j = posisiAmbilX;
- while(j >= 0)
- {
- i = posisiAmbilY;
- ubahDalam("i","j","dalam2");
- namaBaru2 = "kotak" + dalam2;
- if(_root[namaBaru2]._currentframe == 5)
- {
- posisiAmbilX2 = j + 1;
- j = 0;
- }
- if(posisiYChar[dChar] == i && posisiXChar[dChar] == j - 1 || posisiYChar[dChar] == i && posisiXChar[dChar] == j)
- {
- if(_root["char" + dChar].anim_char._currentframe == 1)
- {
- adaOrang = false;
- }
- else
- {
- adaOrang = true;
- }
- }
- j--;
- }
- j = posisiAmbilX2 - 1;
- i = posisiAmbilY;
- if(adaJem[j][i])
- {
- iniJalan = true;
- }
- else
- {
- iniJalan = false;
- }
- if(adaOrang == false)
- {
- cekDalam(2);
- mapping[j][i] = 1;
- xambilTali = true;
- xdiem = true;
- idAmbil2 = setInterval(ambilTali2,250);
- _root["char" + sChar].anim_char.gotoAndStop(6);
- }
- }
- }
- else if(mapping[posisiXChar[sChar] + 1][posisiYChar[sChar]] == 4)
- {
- if(mapping[posisiXChar[sChar]][posisiYChar[sChar]] == 0)
- {
- posisiAmbilX = posisiAmbilX2 = posisiXChar[sChar] + 1;
- posisiAmbilY = posisiYChar[sChar];
- adaOrang = false;
- j = posisiAmbilX + 1;
- while(j <= lebar)
- {
- i = posisiAmbilY;
- ubahDalam("i","j","dalam2");
- namaBaru2 = "kotak" + dalam2;
- if(mapping[j][i] == 1 || _root[namaBaru2]._currentframe == 5)
- {
- posisiAmbilX2 = j - 1;
- j = lebar;
- }
- if(posisiYChar[dChar] == i && posisiXChar[dChar] == j - 1 || posisiYChar[dChar] == i && posisiXChar[dChar] == j)
- {
- if(_root["char" + dChar].anim_char._currentframe == 1)
- {
- adaOrang = false;
- }
- else
- {
- adaOrang = true;
- }
- }
- j++;
- }
- if(adaOrang == false)
- {
- xambilTali = true;
- xdiem = true;
- idAmbil = setInterval(ambilTali,250);
- _root["char" + sChar].anim_char.gotoAndStop(6);
- }
- }
- }
- }
- }
- }
- if(Key.getCode() == 88)
- {
- if(char1._visible == true)
- {
- if(abilChar == "tali")
- {
- abilChar = "jalan";
- menu_mc.tali_mc.gotoAndStop(2);
- menu_mc.jalan_mc.gotoAndStop(1);
- }
- else if(abilChar == "jalan")
- {
- abilChar = "tali";
- menu_mc.tali_mc.gotoAndStop(1);
- menu_mc.jalan_mc.gotoAndStop(2);
- }
- }
- }
- if(Key.getCode() == 32)
- {
- if(sChar == 0)
- {
- cekKuat();
- }
- else if(sChar == 1)
- {
- if(abilChar == "tali")
- {
- if(xtaliNaik == true)
- {
- if(tali > 0)
- {
- if(mapping[posisiXChar[sChar]][posisiYChar[sChar]] == 0)
- {
- sedangBuatTali = true;
- xdiem = true;
- _root["char" + sChar].anim_char.gotoAndStop(3);
- buatTali();
- }
- }
- }
- else if(xtaliTurun == true)
- {
- if(tali > 0)
- {
- if(mapping[posisiXChar[sChar] + 2][posisiYChar[sChar]] == 0)
- {
- sedangBuatTali = true;
- xdiem = true;
- _root["char" + sChar].anim_char.gotoAndStop(6);
- buatTali2();
- }
- }
- }
- }
- else if(abilChar == "jalan")
- {
- buatJalan();
- }
- }
- }
- if(Key.getCode() == 90)
- {
- if(jumlahKeluar == 0)
- {
- if(!xjatuh)
- {
- if(sChar == 0)
- {
- sChar = 1;
- dChar = 0;
- menu_mc.mark_mc.gotoAndStop(1);
- menu_mc.jason_mc.gotoAndStop(2);
- menu_mc.nama_mc.gotoAndStop(1);
- }
- else
- {
- sChar = 0;
- dChar = 1;
- menu_mc.mark_mc.gotoAndStop(2);
- menu_mc.jason_mc.gotoAndStop(1);
- menu_mc.nama_mc.gotoAndStop(2);
- }
- }
- }
- }
- }
- }
- };
- myListener.onKeyUp = function()
- {
- if(mulaiMain)
- {
- if(Key.getCode() == 38)
- {
- xtaliNaik = false;
- }
- if(Key.getCode() == 40)
- {
- xtaliTurun = false;
- }
- }
- };
- Key.addListener(myListener);
- }
- stop();
- mulaiMain = true;
- this.attachMovie("back_mc","back_mc",this.getNextHighestDepth());
- back_mc.kotak1._visible = false;
- back_mc.kotak2._visible = false;
- initAwal();
- init();
- buatKotak();
- buatChar();
- if(satuKaliSaja)
- {
- satuKaliSaja = false;
- input();
- }
- this.attachMovie("menu_mc","menu_mc",this.getNextHighestDepth(),{_x:10,_y:480});
- initMenu();
- idJatuh = setInterval(jatuh,250);
- idWaktu = setInterval(waktuMaju,1000);
- this.onEnterFrame = function()
- {
- menu_mc.tanah = tanah;
- menu_mc.tali = tali;
- menit = int(waktu / 60);
- detik = int(waktu) - menit * 60;
- if(menit < 10)
- {
- menit = "0" + menit;
- }
- if(detik < 10)
- {
- detik = "0" + detik;
- }
- if(int(menit) >= 1)
- {
- menu_mc.waktu = menit + "." + detik;
- }
- else
- {
- menu_mc.waktu = "00." + detik;
- }
- if(jalanKanan)
- {
- if(_root["char" + sChar].anim_char.jalan1._currentframe == 9 || _root["char" + sChar].anim_char.jalan2._currentframe == 9)
- {
- if(sudahJatuh == true)
- {
- sedangNahan = false;
- batuJatuh = true;
- }
- _root["char" + sChar].anim_char.gotoAndStop(1);
- posisiYChar[sChar]++;
- xdiem = false;
- jalanKanan = false;
- _root["char" + sChar]._x = posisiYChar[sChar] * 40;
- cekChar("kanan");
- cekWin();
- }
- }
- if(jalanKiri)
- {
- if(_root["char" + sChar].anim_char.jalan1._currentframe == 9 || _root["char" + sChar].anim_char.jalan2._currentframe == 9)
- {
- if(sudahJatuh == true)
- {
- sedangNahan = false;
- batuJatuh = true;
- }
- _root["char" + sChar].anim_char.gotoAndStop(1);
- _root["char" + sChar].anim_char.gotoAndStop(1);
- posisiYChar[sChar]--;
- xdiem = false;
- jalanKiri = false;
- _root["char" + sChar]._x = posisiYChar[sChar] * 40;
- cekChar("kiri");
- cekWin();
- }
- }
- if(jalanAtas)
- {
- if(sudahAtas[sChar] == false && _root["char" + sChar].anim_char.naik._currentframe == 8 || sudahAtas[sChar] == true && _root["char" + sChar].anim_char.naik._currentframe == 16)
- {
- if(sudahAtas[sChar])
- {
- gerakBawahAwal[sChar] = true;
- posisiXChar[sChar]--;
- _root["char" + sChar].anim_char.gotoAndStop(1);
- }
- xdiem = false;
- jalanAtas = false;
- posisiXChar[sChar]--;
- _root["char" + sChar]._y = posisiXChar[sChar] * 40;
- cekChar("atas");
- cekWin();
- }
- }
- if(jalanBawah)
- {
- if(sudahBawah[sChar] == true && _root["char" + sChar].anim_char.bawah._currentframe == 8 || sudahBawah[sChar] == false && _root["char" + sChar].anim_char.bawah._currentframe == 16)
- {
- sudahAtas[sChar] = false;
- if(awalTurun[sChar] == true)
- {
- sudahAtas[sChar] = true;
- posisiXChar[sChar]++;
- }
- posisiXChar[sChar]++;
- _root["char" + sChar]._y = posisiXChar[sChar] * 40;
- xdiem = false;
- jalanBawah = false;
- cekChar("bawah");
- cekWin();
- }
- else if(sudahBawah[sChar] == false && _root["char" + sChar].anim_char.bawah._currentframe == 8)
- {
- xdiem = false;
- }
- }
- if(jumlahKeluar == 0)
- {
- if(!xdiem)
- {
- menu_mc.jason_mc.enabled = true;
- menu_mc.mark_mc.enabled = true;
- char0.enabled = true;
- char1.enabled = true;
- }
- else
- {
- menu_mc.jason_mc.enabled = false;
- menu_mc.mark_mc.enabled = false;
- char0.enabled = false;
- char1.enabled = false;
- }
- }
- };
-